package com.frejoys.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;


import com.frejoys.common.vo.app.CashPasswordStatusVo;
import com.frejoys.dao.entity.UserCashPassword;

public interface UserCashPasswordService extends IService<UserCashPassword> {

    default UserCashPassword getOnly(QueryWrapper<UserCashPassword> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    default UserCashPassword getOnly(LambdaQueryWrapper<UserCashPassword> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    boolean addInfo(Long userId,String password);

    // 查询用户是否设有密码
    CashPasswordStatusVo cashPassword(Long userId);

    /**
     *  修改密码
     * @param userId
     * @param oldPassword 旧密码
     * @param newPassword 新密码
     * @return
     */
    boolean upInfo(Long userId, String oldPassword, String newPassword);

    // 校验提现账号信息密码
    boolean verifyCashPassword(Long userId, String password);
}
